#ifndef AVATAR_WIDGET_H
#define AVATAR_WIDGET_H

#include <QWidget>

namespace Ui {
class AvatarWidget;
}

class AvatarWidget : public QWidget
{
    Q_OBJECT

public:
    explicit AvatarWidget(const QString &name, const bool &is_add = false, QWidget *parent = nullptr);
    explicit AvatarWidget(const QString &uuid, const QString &name, QWidget *parent = nullptr);
    explicit AvatarWidget(QWidget *parent = nullptr);
    ~AvatarWidget();

public:
    QString name()
    {
        return name_;
    }

    void SetName(const QString &name);

protected:
    QSize sizeHint() const override;

    void paintEvent(QPaintEvent *event) override;

    void mouseReleaseEvent(QMouseEvent *event) override;

signals:
    void signal_btn_checked(QString, bool);

private:
    Ui::AvatarWidget *ui;

    QString uuid_;
    QString name_;
    bool is_add_;
    bool is_read_only_;

    bool is_checked_;
};

#endif // AVATAR_WIDGET_H
